-- poopy drawerrrr: -- local owner = owner ---------------------- -- UTILS -- local Utils = {} function Utils:Create(InstData, Props) local Obj = Instance.new(InstData[1], InstData[2]) for k, v in pairs (Props) do Obj[k] = v end; return Obj end ----------- local ISDOWN = false local eraser = Utils:Create({"Part", script}, { Size = Vector3.one * .15, Anchored = true, CanCollide = false, Name = "eraser" }) local remote = Instance.new("RemoteEvent", NLS([[ local remote = script.RemoteEvent local MOUSEDOWN = false local mouse = owner:GetMouse() local erase = false local UIS = game:service("UserInputService") UIS.InputBegan:connect(function(k, t) if k.KeyCode == Enum.KeyCode.E and not t then erase = not erase; print("eraser: ", erase) end end) local function MOUSEDOWNN() MOUSEDOWN = true remote:FireServer(mouse.Hit.p, false, erase) end; local function MOUSEUP() MOUSEDOWN = false remote:FireServer(mouse.Hit.p, true, erase) end local c1 = mouse.Button1Down:connect(function() MOUSEDOWNN() end); local c2 = mouse.Button1Up:connect(function() MOUSEUP() end); owner.Chatted:connect(function(msg) if msg:lower() == "/q_draw" then c1:disconnect() c2:disconnect() c1 = UIS.InputBegan:connect(function(k, t) if k.KeyCode == Enum.KeyCode.Q then MOUSEDOWNN() end end); c2 = UIS.InputBegan:connect(function(k, t) if k.KeyCode == Enum.KeyCode.Q then MOUSEUP() end end) end end) while task.wait(1/30) do if MOUSEDOWN then remote:FireServer(mouse.Hit.p, false, erase) end end ]], owner.PlayerGui)) local last local wm = Instance.new("WorldModel", script) local th = .15 -- brush thickness local col = Color3.new(1,1,1) -- brush color local HI = .2 local param = RaycastParams.new() param.FilterDescendantsInstances = {wm} local erasing local wm = wm remote.OnServerEvent:connect(function(_, hitp, stop, erase) ISDOWN = not stop if not erasing and erase then eraser.Position = hitp end erasing = erase --[[ Utils:Create({"Part", wm}, { Anchored = true, Size = Vector3.one * 1, Color = Color3.new(0, 0, 0), Position = hitp }) ]] if not erase then for i,v in script:children() do --if v.Name ~= "eraser" and not v:IsA("WorldModel") then v.Parent = wm end end hitp -= Vector3.yAxis * th / 200 if last then local rayc1 = workspace:Raycast(last, CFrame.new(Vector3.zero, hitp).lookVector*math.huge, param) if not rayc1 then rayc1 = {Normal = Vector3.zero} end local LV1, LV2 = CFrame.new(last, hitp).lookVector, CFrame.new(hitp, last).lookVector --LV1 = Vector3.new(LV1.X, LV1.X+LV1.Z, LV1.Z) local a = Utils:Create({"SpawnLocation", wm}, { Anchored = true, Size = Vector3.new(th, HI, (hitp - last).magnitude), Color = col, Position = hitp, Material = "SmoothPlastic", Enabled = false }); a.CFrame = CFrame.new(last, hitp) * CFrame.new(0, 0, -(hitp - last).magnitude / 2) --[[Utils:Create({"SpawnLocation", wm}, { Anchored = true, Size = Vector3.new(HI, th, th), Color = col, CFrame = CFrame.new(last, last+LV1) * CFrame.Angles(0, 0, math.pi/2), --CFrame = CFrame.new(last, last+rayc1.Normal) * CFrame.Angles(0, 0, math.pi/2), Material = "SmoothPlastic", Shape = "Cylinder", Enabled = false })--.Orientation += Vector3.zAxis*90]] Utils:Create({"SpawnLocation", wm}, { Anchored = true, Size = Vector3.new(HI, th, th), Color = col, CFrame = CFrame.new(hitp, hitp+LV2) * CFrame.Angles(0, 0, math.pi/2), --CFrame = CFrame.new(hitp, last) * CFrame.Angles(0, 0, math.pi/2), Material = "SmoothPlastic", Shape = "Cylinder", Enabled = false })--.Orientation += Vector3.zAxis*90 else Utils:Create({"Part", wm}, { Anchored = true, Size = Vector3.new(HI, th, th), Color = col, CFrame = CFrame.Angles(0, 0, math.pi/2) + hitp, Material = "SmoothPlastic", Shape = "Cylinder", }) end last = hitp if stop then last = nil end else for i,v in wm:children() do --v.Parent = script end eraser.Parent = (ISDOWN and script) or nil game:service("TweenService"):Create(eraser, TweenInfo.new(.075), {Position = hitp}):Play() end end) game:service("RunService").Stepped:connect(function() if erasing then local thing = wm:GetPartsInPart(eraser) for i,v in pairs (thing) do if v:IsDescendantOf(script) then v:Destroy() end end end end) owner.Chatted:connect(function(msg) if msg:sub(1,6+2) == "/e brush" then th = tonumber(msg:sub(8+2)) or .25 elseif msg:sub(1,6+2) == "/e color" then col = BrickColor.new(msg:sub(8+2)).Color elseif msg:sub(1,7+2) == "/e smooth" then -- change update fps updat.Value = tonumber(msg:sub(8+2)) end end) -- ross's redstone --[[ local other = RS:Clone() print(f, b, l, r) --local REV = (l and f) and -1 or 1 --other.Parent = script other.TXT.OffsetStudsU = 0 RS.Size = Vector3.new(BS, .1, BS / 2) if f or b then RS.Orientation = Vector3.zero elseif l then RS.Orientation = -RS.Orientation end OFF.Offset = -Vector3.zAxis * (BS / 2) local other2 = RS:Clone() other2.Parent = script other2.Orientation += Vector3.yAxis * 90 other2.OFF.Offset = -Vector3.zAxis * (BS / 2) ]] local function GetNearRS(o, c, cparam, dist) local param = RaycastParams.new() param.FilterDescendantsInstances = cparam or RED_RAY param.FilterType = Enum.RaycastFilterType.Whitelist --local front, back = workspace:Raycast(o, Vector3.zAxis * (BS + .1), param), workspace:Raycast(o, -Vector3.zAxis * (BS + .1), param) --local left, right = workspace:Raycast(o, -Vector3.xAxis * (BS + .1), param), workspace:Raycast(o, Vector3.xAxis * (BS + .1), param) local front, back = workspace:Raycast(o + (Vector3.yAxis * 0), c.lookVector * (dist or BS), param), workspace:Raycast(o + (Vector3.yAxis * 0), -c.lookVector * (dist or BS), param) local left, right = workspace:Raycast(o + (Vector3.yAxis * 0), -c.rightVector * (dist or BS), param), workspace:Raycast(o + (Vector3.yAxis * 0), c.rightVector * (dist or BS), param) --[[ if not front then front = workspace:Raycast(o + (Vector3.yAxis * .05), c.lookVector * (BS / 2), param) end if not back then back = workspace:Raycast(o + (Vector3.yAxis * .05), -c.lookVector * (BS / 2), param) end if not left then left = workspace:Raycast(o + (Vector3.yAxis * .05), -c.rightVector * (BS / 2), param) end if not right then right = workspace:Raycast(o + (Vector3.yAxis * .05), c.rightVector * (BS / 2), param) end ]] return front, back, left, right end